import TYPE from '@design/constant/component-type';

export default {
  menuId: 'desktop-context-menu',
  getMenus(props) {
    if (props.node.type === TYPE.TABLE) {
      return;
    }
    return [
      {
        title: 'edit',
        key: 'edit',
        action: ({ editor, node }) => {
          editor.setSelection([node]);
          if (editor.showPropertyEditor) {
            editor.showPropertyEditor();
          }
        },
      },
      {
        title: 'delete',
        key: 'delete',
        action: ({ editor, node }) => {
          if (editor && node) {
            editor.removeNode(node.key);
          }
        },
      },
    ];
  },
};
